package com.example.springboot1.utils;

import org.apache.commons.lang3.RandomStringUtils;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @author ckj
 * @description TODO
 * @date 2023-02-28 9:00
 */


public class Demo {

    public static void main(String[] args) {
        String attributeName = "距%1m天空%2m";
        Pattern pattern = Pattern.compile("%\\d");
        Matcher matcher = pattern.matcher(attributeName);
        int count = 0;
        while (matcher.find()){
            count++;
        }
        //正则匹配%d的个数和输入框输入值的个数
        String[] valueArr = "2,3".split(",");
        System.out.println(count);
        System.out.println(valueArr.length);

        String random = RandomStringUtils.random(6, false, true);
        System.out.println(random);
    }
}
